package com.xyh.flowershop.context;

import org.springframework.stereotype.Component;

/**
 * @author 小约翰可汗
 * @className WebContext
 * @createTime 2024/4/2919:51
 */
public class WebContext {

    private static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static void save(String userId){
        threadLocal.set(userId);
    }

    public static String get(){
        return threadLocal.get();
    }

    public static void remove(){
        threadLocal.remove();
    }
}
